import Cookies from 'js-cookie'

const TokenKey = 'hrsaas-ihrm-token' // 设定一个独一无二的key
const Timekey = 'hrsaas-time-stamp'
// 获取token
export function getToken() {
  return Cookies.get(TokenKey)
}
// 设置token
export function setToken(token) {
  return Cookies.set(TokenKey, token)
}
// 移除token
export function removeToken() {
  return Cookies.remove(TokenKey)
}
// 保存时间戳
export function getTimeStamp() {
  return Cookies.get(Timekey)
}
// 发起请求的时间 (token注入时间)
export function setTimeStamp() {
  return Cookies.get(Timekey, Date.now())
}
